<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta charset="utf-8">
<title>用户管理-添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>
<script type="text/javascript">
	function getMoreContent() {
		//获得用户输入
		var content = document.getElementById("contractid");
		if (content.value == "") {
			return;
		}
		//然后给服务器发送输入的内容，采用ajax异步发送，所以使用对象叫xmlhttp对象
		xmlHttp = createXMLHttp();
		//给服务器发送数据
		var url = "Searchcontract?contractid=" + escape(content.value);
		//true 表示javascrpt脚本会在send()方法后继续执行，不会等待服务器的响应
		xmlHttp.open("GET", url, true);
		//xmlhttp绑定回调方法，这个回调方法会在xmlhttp状态改变时候调用
		//xmlhttp的状态0-4，只关心4（complete） 这个状态
		// 当完成之后再调用回调方法
		//当状态该改变时候就会调用
		xmlHttp.onreadystatechange = callback;
		xmlHttp.send(null);
	}
	//huode xmlhttp对象
	function createXMLHttp() {
		//
		var xmlHttp;
		if (window.XMLHttpRequest) {
			xmlHttp = new XMLHttpRequest();
		}
		//考虑浏览器的兼容性
		if (window.ActiveXObjext) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			if (!xmlHttp) {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
		}
		return xmlHttp
	}
	function callback() {
		//4代表完成
		if (xmlHttp.readyState == 4) {
			//200服务器响应成功
			//404代表资源未找到，500代表服务器内部错误
			//if(xmlHttp.status==200){
			//交互成功，获得响应的数据是文本格式
			var result = xmlHttp.responseText;
			// 解析获得数据
			//var json=eval("("+result+")");
			//获得数据后就可以动态显示这些数据，把这些数据展示到
			//输入框的下面
			//var a="yes";
			if (result == "yes") {
				alert("该合同号已经存在！");
				document.getElementById("contractid").value = "";
			}

			// }
		}
	}
</script>

<body>
	<div class="x-body">
		<form class="layui-form" action="workcontract" method="post">
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>合同ID
				</label>
				<div class="layui-input-inline">
					<input type="text" id="contractid" name="contractid" required
						lay-verify="pass" class="layui-input" onblur="getMoreContent()">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>学生id
				</label>
				<div class="layui-input-inline">
					<input type="text" name="id" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>中文名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="chinesename" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>英文名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="englishname" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>性别
				</label>
				<div class="layui-input-inline">
					<select class="layui-input" name="sex"><option
							selected="selected">请点击选择</option>
						<option value="男">男</option>
						<option value="女">女</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>生日
				</label>
				<div class="layui-input-inline">
					<input type="date" name="birthday" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>课程名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="coursename" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>总课时
				</label>
				<div class="layui-input-inline">
					<input type="text" name="totalclass" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>剩余课时
				</label>
				<div class="layui-input-inline">
					<input type="text" name="restclass" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>学费
				</label>
				<div class="layui-input-inline">
					<input type="text" name="tuition" required lay-verify="pass"
						class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>缴费状况
				</label>

				<div class="layui-input-inline">
					<!-- <input type="text"  name="chargestate"  required lay-verify="pass" placeholder="请填写：已收讫 或 收款中"
                         class="layui-input"> -->
					<select class="layui-input" name="chargestate"><option
							selected="selected">请点击选择</option>
						<option value="已收讫">已收讫</option>
						<option value="收款中">收款中</option></select>

				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>

			</div>

			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>签约形式
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="signtype"  required lay-verify="pass" placeholder="请填写：新约，续约 或者其他校区转入"
                         class="layui-input"> -->
					<select class="layui-input" name="signtype"><option
							selected="selected">请点击选择</option>
						<option value="新约">新约</option>
						<option value="续约">续约</option>
						<option value="其他转入">其他转入</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>顾问
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="counselor"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="counselor"><option
							selected="selected">请点击选择</option>
						<option value="无">无</option>
						<option value="Maggie王楚蕊">Maggie王楚蕊</option>
						<option value="Wing">Wing</option>
						<option value="Amy陈丹丹">Amy陈丹丹</option>
						<option value="Danny王栋">Danny王栋</option>
						<option value="Tang汤奎秀">Tang汤奎秀</option>
						<option value="狄永霞">狄永霞</option>
						<option value="Grace金">Grace金</option>
						<option value="Julia魏">Julia魏</option>
						<option value="Tina胡婷">Tina胡婷</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>电话顾问
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="phonecounselor"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="phonecounselor"><option
							selected="selected">请点击选择</option>
							<option value="无">无</option>
					<option value="Maggie王楚蕊">Maggie王楚蕊</option>
						<option value="Tina胡婷">Tina胡婷</option>
						<option value="Danny王栋">Danny王栋</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>中教
				</label>
				<div class="layui-input-inline">
					<!-- <input type="text"  name="chineseteacher"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="chineseteacher"><option
							selected="selected">请点击选择</option>
						<option value="Yasmine陈莹">Yasmine陈莹</option>
						<option value="Regina">Regina</option>
						<option value="Nichole">Nichole李婷婷</option>
						<option value="Ada袁晶晶">Ada袁晶晶</option>
						<option value="Lei和磊">Lei和磊</option>
						<option value="Tony王伯元">Tony王伯元</option>
						<option value="Carrol">"Carrol"</option>
						<option value="Maggie王楚蕊">Maggie王楚蕊</option>
						<option value="Amy陈丹丹">Amy陈丹丹</option>
						<option value="Lisa">Lisa</option>
						<option value="Nancy">Nancy</option>
						<option value="Bryce王依然">Bryce王依然</option>
						<option value="Wing">Wing</option>
						<option value="Wheeler彭飞">Wheeler彭飞</option>
						<option value="Abigail冯慧玲">Abigail冯慧玲</option>
						<option value="Sarah鲁梦珏">Sarah鲁梦珏</option>
						<option value="Crystal徐天心">Crystal徐天心</option>
						<option value="Luciya陶艳">Luciya陶艳</option>
						<option value="Eva庄磊">Eva庄磊</option>
						<option value="Juy周露鹭">Juy周露鹭</option>
						<option value="Fiona葛勤">Fiona葛勤</option>
						<option value="Lily胡丽丽">Lily胡丽丽</option></select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>外教
				</label>
				<div class="layui-input-inline">
					<!--  <input type="text"  name="englishteacher"  required lay-verify="pass"
                         class="layui-input"> -->
					<select class="layui-input" name="englishteacher"><option
							selected="selected">请点击选择</option>
						<option value="Oliver">Oliver</option>
						<option value="Akasha">Akasha</option>
						<option value="Julia">Julia</option>
						<option value="Azi">Azi</option>
						<option value="Philip">Philip</option>
						<option value="Anna">Anna</option>
						<option value="Biggie">Biggie</option>
						<option value="Jerry">Jerry</option>
						<option value="Will">Will</option>
						<option value="Michael">Michael</option></select>

				</div>
				<div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div>
			</div>




			<div class="layui-form-item">
				<label for="L_repass" class="layui-form-label"> </label>
				<button class="layui-btn" lay-filter="add" lay-submit="">
					增加</button>
			</div>
		</form>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8">
		
	</script>
	<script src="./js/x-layui.js" charset="utf-8">
		
	</script>
	<!--         <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //自定义验证规则
              form.verify({
                nikename: function(value){
                  if(value.length < 5){
                    return '昵称至少得5个字符啊';
                  }
                }
                ,pass: [/(.+){6,12}$/, '密码必须6到12位']
                ,repass: function(value){
                    if($('#L_pass').val()!=$('#L_repass').val()){
                        return '两次密码不一致';
                    }
                }
              });

              //监听提交
              form.on('submit(add)', function(data){
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("增加成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });
                return false;
              });
              
              
            }); -->
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
	</script>
</body>

</html>